#include "apue.2e/include/apue.h"

int main(void)
{
	int c;

	while ((c=getc(stdin)) != EOF)
		if(putc(c,stdout)==EOF)
			err_sys("out error");

	if (ferror(stdin))
		err_sys("input error");

	exit(0);
}

/**
http://beej.us/guide/bgc/output/html/multipage/getc.html

prototype
	#include <stdio.h>

	int getc(FILE *stream);
	int fgetc(FILE *stream);
	int getchar(void);

getc() returns a character from the specified FILE. From a usage standpoint, it's equivalent to the same fgetc() call, and fgetc() is a little more common to see. Only the implementation of the two functions differs.

fgetc() returns a character from the specified FILE. From a usage standpoint, it's equivalent to the same getc() call, except that fgetc() is a little more common to see. Only the implementation of the two functions differs.
getchar() returns a character from stdin. In fact, it's the same as calling getc(stdin).
*/
